package protocol

import (
	"strconv"
	"strings"
)

// GenerateIPV4Addresses 根据网关地址，生成完整的IPV4网段地址列表
func GenerateIPV4Addresses(gateway string) []string {
	parts := strings.Split(gateway, ".")
	prefix := strings.Join(parts[:3], ".")
	addresses := make([]string, 0, 255)
	for i := 1; i < 256; i++ {
		addresses = append(addresses, prefix+"."+strconv.Itoa(i))
	}

	return addresses
}
